﻿<?php
session_start();
include("admin_resist_mdl.php");
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php

include("../../Modules/conn.php");
$msbm = $_GET["msbm"];

// Tim nhung giang vien thuoc bo mon
$querySelGV = "select * from giang_vien where MSBM = '$msbm'";
$resultSelGV = mysql_query($querySelGV, $conn) or die(mysql_error());
$count = mysql_num_rows($resultSelGV);

if ($count > 0) // Neu ton tai giang vien thuoc bo mon
{ // Thong bao ko the xoa
	header("Location: ../View/admin_cpanel.php?info=delnotallowed");
}
else
{
	$queryDelCNBM = "delete from bo_mon where MSBM = '$msbm'";
	mysql_query($queryDelCNBM, $conn) or die(mysql_error());
	mysql_close();
	header("Location: ../View/admin_cpanel.php?info=delcnbmsucc");
}
?>